var app=angular.module("myapp",[]);
app.controller('login.ctrl',['$scope','$http',function ($scope,$http) {
    $scope.checkLogin=false;
    $scope.doLogin=function () {
        var userInfo={
            username:$scope.username,
            password:$scope.password
        };
        $http({
            url:'/user/login',
            method:'post',
            data:userInfo
        }).then(function (res) {
            if (res.data.status){
                $scope.checkLogin=false;
                location.href='index.html';
            }else {
                $scope.checkLogin=true;
            }
        })
    }
}]);